package com.wordsay.comparator;

import java.util.Comparator;

import com.wordsay.entity.HotItem;

public class CountComparator implements Comparator {

	@Override
	public int compare(Object arg0, Object arg1) {
		
		HotItem obj_1 = (HotItem)arg0;
		HotItem obj_2 = (HotItem)arg1;
		
		if(obj_1.getFrequency() > obj_2.getFrequency()) {
			return -1;
		}else if(obj_1.getFrequency() < obj_2.getFrequency()){
			return 1;
			
		}else {
			
			return 0;
		}

	}

}
